<template>
	<view class="__bdi">
		<view class="form_list" v-if="list.length!=0">
			<view class="item" v-for="item in list" :key='item.id' @click="handEdit(item)">
				<view class="item_top">
					<view class="odd_number">
						{{item.oddNumbers}}
					</view>
					<view class="state">
						<!-- 审核状态 1 未审核 2通过 3不通过 , -->
						<u-tag v-if="item.examineType==2" text="审核通过" type="success" />
						<u-tag v-if="item.examineType==3" text="审核不通过" type="error" />
						<u-tag v-if="item.examineType==1" text="未审核" type="info" />
				<!-- 		<u-tag v-if="item.complete==2" text="个人用户(大陆)" style="margin-left: 10rpx;" />
						<u-tag v-if="item.complete==2" text="个人用户(大陆)" style="margin-left: 10rpx;" /> -->
						<u-tag v-if="item.accountType==1&&item.identity==1" text="个人账户(大陆)" style="margin-left: 10rpx;" />
						<u-tag v-if="item.accountType==1&&item.identity==2" text="个人账户(非大陆)" style="margin-left: 10rpx;" />
						<u-tag v-if="item.accountType==2" text="公司账户" style="margin-left: 10rpx;" />

					</view>
				</view>
				<view v-if="item.examineType==3" class="content">
					失败原因：{{item.examineContent}}
				</view>
				<view class="time_box">
					<view class="odd_time">
						{{$u.timeFormat(item.createTime, 'yyyy年mm月dd日')}}
					</view>
				</view>

			</view>
		</view>
		<u-empty v-else text="暂无审核单" mode="list"></u-empty>

	</view>

</template>

<script>
	export default {
		data() {
			return {
				list: [],
			};
		},
		onLoad() {
			this.init()
		},
		methods: {
			handEdit(row) {
				console.log(row)
				//审核未通过
				//判断是个人还是企业
				if (row.accountType == 1) {
					//判断大陆非大陆 1大陆 2非大陆
					if (row.identity == 1) {
						uni.redirectTo({
							url:'/pages/personalEdit/yesForm/yesForm?id='+row.oddNumbers
						})
						return
					}
					//判断大陆非大陆 1大陆 2非大陆
					if (row.identity == 2) {
						uni.redirectTo({
							url:'/pages/personalEdit/noForm/noForm?id='+row.oddNumbers
						})
						return
					}
				}else{
					uni.redirectTo({
						url:'/pages/company/editCompany?oddNum='+row.oddNumbers,
						fail: (err) => {
							console.log(err)
						}
					})
				}

			},
			async init() {
				const res = await this.$u.api.findExamineOdd()
				this.list = res
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f7f7f7;
	}

	.form_list {

		.item {
			padding: 30rpx;
			box-sizing: border-box;
			background-color: #fff;
			border-bottom: 1px solid #DCDFE6;

			.time_box {
				width: 100%;
				text-align: right;
				color: #333;
				margin-top: 20rpx;
			}

			.item_top {
				// display: flex;
				// align-items: center;
				// justify-content: space-between;
				.state{
					margin-top: 20rpx;
				}
				.odd_number {
					font-weight: 500;
					font-size: 30rpx;
				}
			}

			.content {
				margin: 10rpx 0;
			}
		}
	}
</style>
